import java.io.*;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 86186
 * Date: 2023-10-07
 * Time: 14:38
 */
public class Test2 {
    public static void main(String[] args) {
        try (OutputStream outputStream = new FileOutputStream("d:/test.txt")) {
            PrintWriter printWriter = new PrintWriter(outputStream);
            printWriter.print("你好世界");
            printWriter.println("我爱Java");
            printWriter.println("我要成为Java高级工程师");
            printWriter.flush();
        } catch (FileNotFoundException e) {
            throw new RuntimeException(e);
        } catch (IOException e) {
            throw new RuntimeException(e);
        }
    }
}
